<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>交流区 - 禾行通</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .forum-card {
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            padding: 1.5rem;
            margin-bottom: 1rem;
            transition: transform 0.3s ease;
        }
        .forum-card:hover {
            transform: translateY(-2px);
        }
        .category-tab {
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            padding: 1rem;
            margin-bottom: 1.5rem;
        }
        .question-item {
            border-bottom: 1px solid #e9ecef;
            padding: 1rem 0;
        }
        .question-item:last-child {
            border-bottom: none;
        }
        .tag {
            background: #e9ecef;
            color: #495057;
            padding: 0.25rem 0.5rem;
            border-radius: 12px;
            font-size: 0.8rem;
            margin-right: 0.5rem;
        }
        .tag.hot {
            background: #dc3545;
            color: white;
        }
        .tag.solved {
            background: #28a745;
            color: white;
        }
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        .stats-item {
            text-align: center;
            padding: 0.5rem;
        }
        .expert-badge {
            background: linear-gradient(45deg, #ffd700, #ffed4e);
            color: #333;
            padding: 0.2rem 0.5rem;
            border-radius: 10px;
            font-size: 0.7rem;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <nav class="navbar navbar-expand-lg navbar-dark" style="background: linear-gradient(45deg, #28a745, #20c997);">
        <div class="container-fluid">
            <a class="navbar-brand" href="/dashboard">
                <i class="fas fa-seedling me-2"></i>禾行通
            </a>
            <div class="navbar-nav ms-auto">
                <a class="nav-link" href="/dashboard"><i class="fas fa-home me-1"></i>首页</a>
                <a class="nav-link" href="/vehicles"><i class="fas fa-tractor me-1"></i>设备管理</a>
                <a class="nav-link" href="/fields"><i class="fas fa-map me-1"></i>田地管理</a>
                <a class="nav-link" href="/community/circle"><i class="fas fa-users me-1"></i>农友圈</a>
                <a class="nav-link active" href="/community/forum"><i class="fas fa-comments me-1"></i>交流区</a>
            </div>
        </div>
    </nav>

    <div class="container mt-4">
        <!-- 分类标签 -->
        <div class="category-tab">
            <div class="d-flex justify-content-between align-items-center">
                <div>
                    <button class="btn btn-primary me-2 active" data-category="all">全部问题</button>
                    <button class="btn btn-outline-primary me-2" data-category="tech">技术问题</button>
                    <button class="btn btn-outline-primary me-2" data-category="equipment">设备相关</button>
                    <button class="btn btn-outline-primary me-2" data-category="crop">作物种植</button>
                    <button class="btn btn-outline-primary me-2" data-category="market">市场行情</button>
                    <button class="btn btn-outline-primary" data-category="policy">政策法规</button>
                </div>
                <button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#askQuestionModal">
                    <i class="fas fa-plus me-1"></i>提问
                </button>
            </div>
        </div>
        
        <div class="row">
            <!-- 左侧问题列表 -->
            <div class="col-md-8">
                <!-- 热门问题 -->
                <div class="forum-card">
                    <div class="question-item">
                        <div class="d-flex">
                            <div class="stats-item me-3">
                                <div class="text-primary fw